Skip to content

Add test that pins down the order that middleware is executed in #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dan98765
Copy link
Collaborator

Create dedicated test file for middleware (test_middleware.py) and add test that pins down the order that middleware is executed in.

This PR:

  1. Moves existing middleware tests into new dedicated file test_middleware.py
  2. Adds a test (test_middleware_chain) that asserts on the order middleware is executed in, as discussed in Order of Middlewares #155. It does not change that behavior.

Info about pytest's capsys can be found here: https://docs.pytest.org/en/latest/capture.html

@dan98765
Copy link
Collaborator Author

dan98765 commented Jul 6, 2018

I'm going to do this as 2 separate PRs. First graphql-python/graphql-core#197 to give middleware its own separate test file. Then I'll revisit this branch so the diff is just focused on the new testing.

@syrusakbary
Copy link
Member

Sounds good! Let me know once is ready to re-review :)

@dan98765
Copy link
Collaborator Author

dan98765 commented Jul 13, 2018

Merged the latest master, the diff became much smaller. Also added type annotations so tox -e mypy passes.

@syrusakbary this is ready for re-review.

@syrusakbary
Copy link
Member

Looks good. Merging

@syrusakbary syrusakbary merged commit c27daa5 into graphql-python:master Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants